package com.logic.landseaserver.ws.interceptor;

import com.logic.common.enums.LogTypeEnum;
import com.logic.common.security.SecurityUtils;
import com.logic.common.util.SysUtil;
import com.logic.landseaserver.service.Action;
import com.logic.landseaserver.ws.ContractRest;
import com.logic.system.service.impl.LogService;
import org.aspectj.lang.JoinPoint;
import org.aspectj.lang.annotation.*;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;

import javax.servlet.http.HttpServletRequest;
import java.lang.reflect.Method;

/**
 * Created by quintina on 2017/8/10.
 */
/*@Aspect
@Component*/
public class ExceptionLogAspect {

    private static final Logger logger = LoggerFactory.getLogger(ContractRest.class);


   /* @Pointcut("@annotation(io.swagger.annotations.ApiOperation)")
    public void exceptionPointCut() {
    }*/

    /*@Before("execution(* *.*(..)))")
    public void before(JoinPoint joinPoint) {
        String className = joinPoint.getTarget().getClass().getName();
        String methodName = joinPoint.getSignature().getName();
        logger.warn(className + "的" + methodName + "执行了");
        Object[] args = joinPoint.getArgs();
        StringBuilder log = new StringBuilder("入参为");
        for (Object arg : args) {
            log.append(arg + " ");
        }
        logger.warn(log.toString());
    }*/

   /* @AfterThrowing(value = "exceptionPointCut()", throwing = "e")
    public void afterThrowing(Throwable e) {
        logger.error("通知中发现未知异常", e);
    }
*/
}
